#!/usr/bin/env python
'''Launch wikipedia page for today'''

__author__ = "Miki Tebeka <miki.tebeka@gmail.com>"
__license__ = "BSD" # see LICENSE

from time import strftime
import webbrowser

def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    from optparse import OptionParser

    parser = OptionParser("usage: %prog")

    opts, args = parser.parse_args(argv[1:])
    if len(args) != 0:
        parser.error("wrong number of arguments") # Will exit

    day = strftime("%d")
    # Change 06 -> 6
    if day.startswith("0"):
        day = day[1]

    url = "http://en.wikipedia.org/wiki/" + strftime("%B") + "_" + day
    webbrowser.open(url)

if __name__ == "__main__":
    main()
